/**
 * 预付款
 */
interface advanceList {
    /**
     * 预付款
     */
    advancePrice: number;
    /**
     * 预付款付款方式
     */
    advancePriceType: string;
}

/**
 * 电子合同列表返回值
 */
interface EContractListResponse {
    /**
     * 序号
     */
    index: number;
    /**
     * 承运单id 
     */
    carrierOrderId:string;
    /**
     * 合同号
     */
    contractNumber: string;
    /**
     * 客户单位
     */
    clientName: string;
    /**
     * 发货地址
     */
    origin: string;
    /**
     * 送货地址
     */
    destination: string;
    /**
     * 发货时间
     */
    deliveryTime: string;
    /**
     * 车牌号
     */
    carCode: string;
    /**
     * 客服专员
     */
    customerName: string;
    /**
     * 电子合同编号id
     */
    electronicContractNumber: string;
    /**
     * 合同状态
     */
    eContractStatus: string;
    /**
    * 补充协议编号id
    */
    agreementContractNumber: string;
    /**
     * 补充协议状态
     */
    agreementEContractStatus: string;
    /**
     * 合同订立日期
     */
    contractTime: string;
}

/**
 * 电子合同列表返回值
 */
interface EContractDownloadResponse {
    /**
     * 序号
     */
    index: number;
    /**
     * 合同号
     */
    contractNumber: string;
    /**
     * 合同类型
     */
    eContractType:string;
    /**
     * 客户单位
     */
    clientName: string;
    /**
     * 发货时间
     */
    deliveryTime: string;
    /**
     * 客服专员
     */
    customerServiceName: string;
    /**
     * 操作人
     */
    operatorName: string;
    /**
     * 下载时间
     */
    creationTime: string;
}



/**
 * 意见反馈列表返回值
 */
interface feedBackListResponse{
    /**
     * 意见反馈id
     */
    id:string;
    /**
     * 标题
     */
    title:string;
    /**
     * 反馈平台
     */
    feedBackPlatform:string;
    /**
     * 反馈用户名
     */
    feedBackUserName:string;
    /**
     * 反馈人姓名
     */
    feedBackName:string;
    /**
     * 反馈时间
     */
    creationTime:string;
}

/**
 * 意见反馈列表详情
 */
interface FeedBackDetailResponse extends BaseResponse {
    /**
     * 意见反馈id
     */
    id:string;
    /**
     * 标题
     */
    title:string;
    /**
     * 反馈平台
     */
    feedBackPlatform:string;
    /**
     * 反馈用户名
     */
    feedBackUserName:string;
    /**
     * 反馈人姓名
     */
    feedBackName:string;
    /**
     * 反馈时间
     */
    creationTime:string;
    /**
     * 反馈内容
     */
    content:string;
    /**
     * 图片
     */
    attachment:Array<attachmentList>
}


/**
 * 运维服务
 */
interface IOperationService {
    /**
     *添加电子合同下载记录
     * v1.0
     * @param id 承运单id
     * @param eContractType 电子合同类型
     
     */
    AddEContractDownloadRecord(id: string, eContractType: string,operatorName:string): ng.IHttpPromise<BaseResponse>;


    /**
      *获取APP竞价列表
      * v1.0
      *@param id 订单编号
      */
    quotation(id: string): ng.IHttpPromise<ListResponse<quotationResponse>>;
    /**
     * 获取订单列表
     * v1.0
     * @param orderby 排序字段枚举
     * @param asc 是否升序
     * @param OrderId 订单编号集合(以逗号分隔)
     * @param ClientName 客户单位
     * @param Route 路线地址
     * @param ShipStartTime 发货起始时间
     * @param ShipEndTime 发货结束时间
     * @param Status 订单状态集合（逗号分割）
     * @param PlaceOrderStartTime 下单开始时间
     * @param PlaceOrderEndTime 下单结束时间
     * @param DispatchOfficerId 调度专员编号
     * @param ShipAddress 发货地址
     * @param DeliverAddress 送货地址
     * @param CustomerServiceId 客服专员编号
     * @param skip 跳过项数
     * @param count 获取项数
     */
    getOrderList(orderby: string, asc: boolean, OrderId: string, ClientName: string, Route: string, ShipStartTime: string, ShipEndTime: string, Status: string, PlaceOrderStartTime: string,
        PlaceOrderEndTime: string, DispatchOfficerId: string, ShipAddress: string, DeliverAddress: string, CustomerServiceId: string, skip: number, count: number): ng.IHttpPromise<ListResponse<orderList>>;
    /**
     * 获取承运单
     * v1.0
     * @param orderby 排序字段 枚举
     * @param asc 是否升序
     * @param OrderId 订单编号（单个）
     * @param ClientName 客户单位
     * @param Route 线路地址
     * @param ShipStartTime 发货开始时间
     * @param ShipEndTime 发货结束时间
     * @param Status 订单状态
     * @param PlaceOrderStartTime 下单开始时间
     * @param PlaceOrderEndTime 下单结束时间
     * @param ShipAddress 发货地址
     * @param DeliverAddress 送货地址
     * @param CarCode 承运车牌号
     * @param ContractNum 合同号
     * @param ContractStatus 合同状态
     * @param ReceiptPriceStatus 回单状态
     * @param OilCardStatus 油卡状态
     * @param CustomerServiceOfficerId 客服专员
     * @param TempCustomerServiceOfficerId 临时客服专员
     * @param DispatchOfficerId 调度专员
     * @param CarLength 车长
     * @param CarrierName 承运商名称
     * @param Driver 驾驶员名称
     * @param skip 跳过项数
     * @param count 获取项数
     */
    getCarryOrderList(orderby: string, asc: boolean, OrderId: string, ClientName: string, Route: string, ShipStartTime: string, ShipEndTime: string,
        Status: string, PlaceOrderStartTime: string, PlaceOrderEndTime: string, ShipAddress: string, DeliverAddress: string, CarCode: string, ContractNum: string,
        ContractStatus: string, ReceiptPriceStatus: string, OilCardStatus: string, CustomerServiceOfficerId: string, TempCustomerServiceOfficerId: string, DispatchOfficerId: string,
        CarLength: string, CarrierName: string, Driver: string, skip: number, count: number): ng.IHttpPromise<ListResponse<carryOrderListResponse>>;


    /**
     * 获取承运单数量
    * v1.0
    */
    carrierOrderCount(orderby: string, asc: boolean, OrderId: string, ClientName: string, Route: string, ShipStartTime: string, ShipEndTime: string,
        Status: string, PlaceOrderStartTime: string, PlaceOrderEndTime: string, ShipAddress: string, DeliverAddress: string, CarCode: string, ContractNum: string,
        ContractStatus: string, ReceiptPriceStatus: string, OilCardStatus: string, CustomerServiceOfficerId: string, TempCustomerServiceOfficerId: string, DispatchOfficerId: string,
        CarLength: string, CarrierName: string, Driver: string): ng.IHttpPromise<ListResponse<carryOrderListResponse>>;


    /**
     * 获取电子合同列表
     * v1.0
     * @param clientName 客户单位
     * @param contractNumber 合同编号
     * @param carCode 承运车牌号
     * @param customerServiceId 客服专员
     * @param origin 起始地
     * @param destination 目的地
     * @param deliveryBegin 发货开始时间
     * @param deliveryEnd 发货结束时间    
     * @param econtractStatus 合同状态
     * @param agreementEContractStatus 补充协议状态
     * @param contractStartTime 合同订立起始时间
     * @param contractEndTime 合同订立结束时间
     * @param skip 跳过项数
     * @param count 获取项数
     */
    getEContractList(clientName: string, contractNumber: string, carCode: string, customerServiceId: string, origin: string, destination: string, deliveryBegin: string, deliveryEnd: string, econtractStatus: string, agreementEContractStatus: string, contractStartTime: string, contractEndTime: string, skip: number, count: number): ng.IHttpPromise<ListResponse<EContractListResponse>>;

    /**
     * 获取电子合同下载记录列表
     * v1.0
     * @param clientName 客户单位
     * @param contractNumber 合同编号
     * @param econtractType 电子合同类型
     * @param customerServiceId 客服专员
     * @param downloadStartTime 下载起始时间
     * @param downloadEndTime 下载结束时间
     * @param skip 跳过项数
     * @param count 获取项数
     */
    getDownloadRecordList(clientName: string, contractNumber: string, econtractType: string, customerServiceId: string, downloadStartTime: string, downloadEndTime: string, skip: number, count: number): ng.IHttpPromise<ListResponse<EContractDownloadResponse>>;
    
    /**
     * 获取子单列表
     * v1.0
     * @param id 订单编号
     */
    getOrderChildList(id: string): ng.IHttpPromise<ListResponse<orderChildListResponse>>;
    /**
     * 获取费用申请列表
     * v1.0
     * @param id 承运单编号
     */
    getFeeList(id: string): ng.IHttpPromise<ListResponse<feeListResponse>>;
    /**
     * 获取应收登记列表
     * v1.0
     * @param id 订单编号
     */
    getReceivableList(id: string): ng.IHttpPromise<ListResponse<receivableListResponse>>;
    /**
     * 获取订单详情
     * v1.0
     * @param id 订单编号
     */
    getOrderDetail(id: string): ng.IHttpPromise<detailResponse>;
    /**
     * 获取子单详情
     * v1.0
     * @param id 子单编号
     */
    getOrderChildDetail(id: string): ng.IHttpPromise<orderChildResponse>;
    /**
     * 获取承运单详情
     * v1.0
     * @param id 承运单编号
     */
    getCarryOrder(id: string): ng.IHttpPromise<carryOrderResponse>;
    /**
    * 获取承运单报表列表
    * v1.0
    * @param orderby 排序枚举
    * @param asc 是否升序
    * @param ContractNum 合同号
    * @param ClientName 客户名称
    * @param ShipAddress 发货地址
    * @param DeliverAddress 送货地址
    * @param ShipStartTime 发货开始时间
    * @param ShipEndTime 发货结束时间
    * @param CarrierName 承运商名称
    * @param Driver 驾驶员
    * @param skip 跳过项
    * @param count 总项
    */
    getReportCarrierOrderList(orderby: string, asc: boolean, ContractNum: string, ClientName: string, ShipAddress: string, DeliverAddress: string, ShipStartTime: string, ShipEndTime: string, CarrierName: string, Driver: string, skip: number, count: number): ng.IHttpPromise<ListResponse<reportCarrierOrderListResponse>>;
    /**
     * 获取银行列表
     * v1.0
     * @param carId 车辆编号
     * @param carrierId 承运商编号
     * @param BankCode 银行卡号
     * @param IsVehicle 是否是车场查询
     * @param skip 跳过项数
     * @param count 获取项数
     */
    getBankList(carid: string, carrierid: string, BankCode: string, IsVehicle: boolean, skip: number, count: number): ng.IHttpPromise<ListResponse<BankListItemResponse>>;
    /**
     * 获取帐户详情
     * v1.0
     * @param id 账户id
     */
    getBankDetail(id: string): ng.IHttpPromise<BankDetailResponse>;
    /**
     * 获取银行卡信息
     * @param id 银行卡号
     */
    BankInfo(id: string): ng.IHttpPromise<any>;
    /**
     * 获取车辆列表
     * v1.0
     * @param orderby 排序字段枚举
     * @param asc 是否升序
     * @param carcode 车牌号
     * @param cartype 车型
     * @param carlength 车长
     * @param inputperson 录入人
     * @param driver 驾驶员
     * @param driverphone 驾驶员号码
     * @param carriercategory 承运类别
     * @param mainroute 主营线路
     * @param isenabled 是否启用
     * @param skip 跳过项数
     * @param count 获取项数
     */
    getCarList(orderby: string, asc: boolean, carcode: string, cartype: string, carlength: string, inputperson: string, driver: string, driverphone: string, carriercategory: string, mainroute: string,
        isenabled: boolean, skip: number, count: number): ng.IHttpPromise<ListResponse<CarListItemResponse>>;
    /**
     * 获取交易记录列表
     * v1.0
     * @param carcode 车牌号
     * @param goodsname 货物名称
     * @param goodsnum 货物数量
     * @param route 线路地址
     * @param shipaddress 发货地址
     * @param deliveraddress 送货地址
     * @param skip 跳过项数
     * @param count 获取项数
     */
    getTradingRecordList(carcode: string, goodsname: string, goodsnum: string, route: string, shipaddress: string, deliveraddress: string, skip: number, count: number): ng.IHttpPromise<ListResponse<TradingRecordListItemResponse>>;
    /**
     * 获取诚信记录
     * v1.0
     * @param carCode 车牌号
     * @param appraiserId 评价人编号
     */
    getEvaluateList(carcode: string, appraiserid: string, skip: number, count: number): ng.IHttpPromise<ListResponse<EvaluateListItemResponse>>;
    /**
     * 获取车辆详情
     * v1.0
     * @param id 车辆编号
     */
    getCarDetail(id: string): ng.IHttpPromise<CarDetailResponse>;
    /**
     * 获取承运商列表
     * v1.0
     * @param orderby 排序字段 枚举
     * @param asc 是否升序
     * @param name 承运商名称
     * @param phone 承运商号码
     * @param type 承运商类型
     * @param inputperson 录入人
     * @param level 承运商等级
     * @param mainroute 主营路线
     * @param isenabled 是否启用
     * @param skip 跳过项数
     * @param count 获取项数
     */
    getCarrierList(orderby: string, asc: boolean, name: string, phone: string, type: string, inputperson: string, level: string, mainroute: string,
        isenabled: boolean, skip: number, count: number): ng.IHttpPromise<ListResponse<CarrierListItemResponse>>;
    /**
     * 承运商所属车辆列表
     * v1.0
     * @param id 承运商编号
     */
    getBelongCarrierCarList(id: string, skip: number, count: number): ng.IHttpPromise<ListResponse<BelongCarrierCarListResponse>>;
    /**
     * 获取承运商详细
     * v1.0
     * @param id 承运商编号
     */
    getCarrierDetail(id: string): ng.IHttpPromise<CarrierDetailResponse>;
    /**
     * 获取路线列表
     * v1.0
     * @param carId 车辆编号
     * @param carrierId 承运商编号
     * @param skip 跳过项数
     * @param count 获取项数
     */
    getRouteLineList(carid: string, carrierid: string, skip: number, count: number): ng.IHttpPromise<ListResponse<RouteLineListItemResponse>>;
    /**
     * 修改承运单承运商信息
     * v1.0
     * @param carrier 乘运商名称
     * @param carrierId 承运商编号
     * @param carrierPhone 结算方号码
     * @param carrierType 承运商类型
     */
    updateCarrier(id: string, carrier: string, carrierId: string, carrierPhone: string, carrierType: string): ng.IHttpPromise<BaseResponse>;
    /**
     * 修改驾驶员和车辆相关信息
     * v1.0
     * @param driverUserId  来货拉用户编号
     * @param carCode 车牌号
     * @param driver 驾驶员姓名
     * @param driverPhone 驾驶员号码
     * @param carlength 车长
     * @param vehicleType 车型
     * @param permitNumber 道路运输许可证号
     * @param countrySubdivisionProvinceCode 所属辖区(省)
     * @param countrySubdivisionCityCode 所属辖区(市)
     * @param countrySubdivisionCountryCode 所属辖区(区)
     * @param roadTransportCertificateNumber 道路运输证字号
     */
    updateCar(id: string, driverUserId: string, carCode: string, driver: string, driverPhone: string, carLength: string, vehicleType: string, permitNumber: string, countrySubdivisionProvinceCode: string, countrySubdivisionCityCode: string, countrySubdivisionCountryCode: string, roadTransportCertificateNumber: string): ng.IHttpPromise<BaseResponse>;
    /**
     * 修改应付相关信息
     * v1.0
     * @param id 
     */
    updatePayable(id: string, payablePrice: number, payableSummary: string, receiptPrice: number, bankCode: string, bankName: string, holder: string, payablePriceUnit: string, receiptPriceUnit: string, advancePaymentList: Array<advanceList>): ng.IHttpPromise<BaseResponse>;
    /**
     * 修改合同
     * v1.0
     * @param carrierOrderId 承运单编号
     * @param contractId 合同编号
     * @param contractNumber 合同短号
     * @param contractGoodsNum 合同货物数量
     * @param contractGoodsNumUnit 合同货物数量单位
     * @param oilCarNum 油卡卡号
     * @param OilCardStatus 油卡状态
     * @param auxiliaryTool 辅助工具
     * @param engineNumber 发动机号
     * @param frameNumber 车架号
     * @param trailerNumber 挂车号
     * @param trailerFrameNumber 挂车车架号
     * @param driverLicenseNumber 驾驶证
     * @param altermatePhone 备用电话
     * @param TotalPrice 运费总价
     * @param remarks 备注
     */
    updateContract(carrierOrderId: string, contractId: string, contractNumber: string, contractGoodsNum: number, contractGoodsNumUnit: string, oilCarNum: string, OilCardStatus: string, auxiliaryTool: string,
        engineNumber: string, frameNumber: string, trailerNumber: string, trailerFrameNumber: string, driverLicenseNumber: string, altermatePhone: string,totalPrice:number,remarks:string): ng.IHttpPromise<BaseResponse>;
    /**
     * 修改附件
     * v1.0
     * @param carrierOrderId 承运单ID
     * @param attachmentList 附件列表
     */
    updateAttachment(carrierOrderId: string, attachmentList: Array<string>): ng.IHttpPromise<BaseResponse>;




    /**
     * 获取意见反馈列表
     * v1.0
     * @param platform 反馈设备
     * @param feedBackName 反馈人姓名
     * @param startTime 反馈起始时间
     * @param endTime 反馈结束时间
     */
    getOpinionList(platform: string, feedBackName: string, startTime: string, endTime: string, skip: number, count: number): ng.IHttpPromise<ListResponse<feedBackListResponse>>;
    

    /**
     * 获取意见反馈详情
     * @param id 意见反馈ID
     */
    getOpinionDetail(id:string):ng.IHttpPromise<FeedBackDetailResponse>;

    /**
     * 添加意见反馈
     * v1.0
     * @param Title 标题
     * @param Content 内容
     * @param FeedBackPlatform 反馈平台
     * @param Attachment 附件列表
     */
    addOpinion(Title: string, Content: string, FeedBackPlatform: string, Attachment:Array<attachmentList>): ng.IHttpPromise<BaseResponse>;
    


}

class operationService implements IOperationService {
    constructor(private http: ng.IHttpService, private route: routeService) {
    }

    /**
     * 添加电子合同下载记录
     */
    AddEContractDownloadRecord(id: string,eContractType:string,operatorName:string): ng.IHttpPromise<BaseResponse> {
        return this.http<BaseResponse>({
        method: "POST",
        url: this.route.getUrl('operation/AddEContractDownloadRecord'),
        data: {
            id: id,
            eContractType:eContractType,
            operatorName:operatorName
        }
        });
    }

    quotation(id: string): ng.IHttpPromise<ListResponse<quotationResponse>> {
        return this.http<ListResponse<quotationResponse>>({
            method: "GET",
            url: this.route.getUrl('operation/QuotationList?id={{id}}', {
                id: id
            })
        })
    }

    getOrderList(orderby: string, asc: boolean, OrderId: string, ClientName: string, Route: string, ShipStartTime: string, ShipEndTime: string, Status: string, PlaceOrderStartTime: string, PlaceOrderEndTime: string, DispatchOfficerId: string, ShipAddress: string,
        DeliverAddress: string, CustomerServiceId: string, skip: number, count: number): ng.IHttpPromise<ListResponse<orderList>> {
        return this.http<ListResponse<orderList>>({
            method: "GET",
            url: this.route.getUrl('operation/OrderList?orderby={{orderby}}&asc={{asc}}&OrderId={{OrderId}}&ClientName={{ClientName}}&Route={{Route}}&ShipStartTime={{ShipStartTime}}&ShipEndTime={{ShipEndTime}}&Status={{Status}}&PlaceOrderStartTime={{PlaceOrderStartTime}}&PlaceOrderEndTime={{PlaceOrderEndTime}}&DispatchOfficerId={{DispatchOfficerId}}&ShipAddress={{ShipAddress}}&DeliverAddress={{DeliverAddress}}&CustomerServiceId={{CustomerServiceId}}&skip={{skip}}&count={{count}}', {
                orderby: orderby,
                asc: asc,
                OrderId: OrderId,
                ClientName: ClientName,
                Route: Route,
                ShipStartTime: ShipStartTime,
                ShipEndTime: ShipEndTime,
                Status: Status,
                PlaceOrderStartTime: PlaceOrderStartTime,
                PlaceOrderEndTime: PlaceOrderEndTime,
                DispatchOfficerId: DispatchOfficerId,
                ShipAddress: ShipAddress,
                DeliverAddress: DeliverAddress,
                CustomerServiceId: CustomerServiceId,
                skip: skip,
                count: count
            })
        })
    }

    getCarryOrderList(orderby: string, asc: boolean, OrderId: string, ClientName: string, Route: string, ShipStartTime: string, ShipEndTime: string,
        Status: string, PlaceOrderStartTime: string, PlaceOrderEndTime: string, ShipAddress: string, DeliverAddress: string, CarCode: string, ContractNum: string,
        ContractStatus: string, ReceiptPriceStatus: string, OilCardStatus: string, CustomerServiceOfficerId: string, TempCustomerServiceOfficerId: string, DispatchOfficerId: string,
        CarLength: string, CarrierName: string, Driver: string, skip: number, count: number): ng.IHttpPromise<ListResponse<carryOrderListResponse>> {
        return this.http<ListResponse<carryOrderListResponse>>({
            method: "GET",
            url: this.route.getUrl('operation/CarryOrderList?orderby={{orderby}}&asc={{asc}}&OrderId={{OrderId}}&ClientName={{ClientName}}&Route={{Route}}&ShipStartTime={{ShipStartTime}}&ShipEndTime={{ShipEndTime}}&Status={{Status}}&PlaceOrderStartTime={{PlaceOrderStartTime}}&PlaceOrderEndTime={{PlaceOrderEndTime}}&ShipAddress={{ShipAddress}}&DeliverAddress={{DeliverAddress}}&CarCode={{CarCode}}&ContractNum={{ContractNum}}&ContractStatus={{ContractStatus}}&ReceiptPriceStatus={{ReceiptPriceStatus}}&OilCardStatus={{OilCardStatus}}&CustomerServiceOfficerId={{CustomerServiceOfficerId}}&TempCustomerServiceOfficerId={{TempCustomerServiceOfficerId}}&DispatchOfficerId={{DispatchOfficerId}}&CarLength={{CarLength}}&CarrierName={{CarrierName}}&Driver={{Driver}}&skip={{skip}}&count={{count}}', {
                orderby: orderby,
                asc: asc,
                OrderId: OrderId,
                ClientName: ClientName,
                Route: Route,
                ShipStartTime: ShipStartTime,
                ShipEndTime: ShipEndTime,
                Status: Status,
                PlaceOrderStartTime: PlaceOrderStartTime,
                PlaceOrderEndTime: PlaceOrderEndTime,
                ShipAddress: ShipAddress,
                DeliverAddress: DeliverAddress,
                CarCode: CarCode,
                ContractNum: ContractNum,
                ContractStatus: ContractStatus,
                ReceiptPriceStatus: ReceiptPriceStatus,
                OilCardStatus: OilCardStatus,
                CustomerServiceOfficerId: CustomerServiceOfficerId,
                TempCustomerServiceOfficerId: TempCustomerServiceOfficerId,
                DispatchOfficerId: DispatchOfficerId,
                CarLength: CarLength,
                CarrierName: CarrierName,
                Driver: Driver,
                skip: skip,
                count: count
            })
        });
    }


    carrierOrderCount(orderby: string, asc: boolean, OrderId: string, ClientName: string, Route: string, ShipStartTime: string, ShipEndTime: string,
        Status: string, PlaceOrderStartTime: string, PlaceOrderEndTime: string, ShipAddress: string, DeliverAddress: string, CarCode: string, ContractNum: string,
        ContractStatus: string, ReceiptPriceStatus: string, OilCardStatus: string, CustomerServiceOfficerId: string, TempCustomerServiceOfficerId: string, DispatchOfficerId: string,
        CarLength: string, CarrierName: string, Driver: string): ng.IHttpPromise<ListResponse<carryOrderListResponse>> {
        return this.http<ListResponse<any>>({
          method: "GET",
          url: this.route.getUrl('operation/carrierordercount?orderby={{orderby}}&asc={{asc}}&OrderId={{OrderId}}&ClientName={{ClientName}}&Route={{Route}}&ShipStartTime={{ShipStartTime}}&ShipEndTime={{ShipEndTime}}&Status={{Status}}&PlaceOrderStartTime={{PlaceOrderStartTime}}&PlaceOrderEndTime={{PlaceOrderEndTime}}&ShipAddress={{ShipAddress}}&DeliverAddress={{DeliverAddress}}&CarCode={{CarCode}}&ContractNum={{ContractNum}}&ContractStatus={{ContractStatus}}&ReceiptPriceStatus={{ReceiptPriceStatus}}&OilCardStatus={{OilCardStatus}}&CustomerServiceOfficerId={{CustomerServiceOfficerId}}&TempCustomerServiceOfficerId={{TempCustomerServiceOfficerId}}&DispatchOfficerId={{DispatchOfficerId}}&CarLength={{CarLength}}&CarrierName={{CarrierName}}&Driver={{Driver}}', {
            orderby: orderby,
            asc: asc,
            OrderId: OrderId,
            ClientName: ClientName,
            Route: Route,
            ShipStartTime: ShipStartTime,
            ShipEndTime: ShipEndTime,
            Status: Status,
            PlaceOrderStartTime: PlaceOrderStartTime,
            PlaceOrderEndTime: PlaceOrderEndTime,
            ShipAddress: ShipAddress,
            DeliverAddress: DeliverAddress,
            CarCode: CarCode,
            ContractNum: ContractNum,
            ContractStatus: ContractStatus,
            ReceiptPriceStatus: ReceiptPriceStatus,
            OilCardStatus: OilCardStatus,
            CustomerServiceOfficerId: CustomerServiceOfficerId,
            TempCustomerServiceOfficerId: TempCustomerServiceOfficerId,
            DispatchOfficerId: DispatchOfficerId,
            CarLength: CarLength,
            CarrierName: CarrierName,
            Driver: Driver,
          })
        });
      }

    /**
     * 获取电子合同列表
     */
    getEContractList(clientName: string, contractNumber: string, carCode: string, customerServiceId: string, origin: string, destination: string, deliveryBegin: string, deliveryEnd: string, econtractStatus: string, agreementEContractStatus: string, contractStartTime: string, contractEndTime: string, skip: number, count: number): ng.IHttpPromise<ListResponse<EContractListResponse>> {
        return this.http<ListResponse<EContractListResponse>>({
            method: "GET",
            url: this.route.getUrl('operation/EContractList?clientName={{clientName}}&contractNumber={{contractNumber}}&carCode={{carCode}}&customerServiceId={{customerServiceId}}&origin={{origin}}&destination={{destination}}&deliveryBegin={{deliveryBegin}}&deliveryEnd={{deliveryEnd}}&econtractStatus={{econtractStatus}}&agreementEContractStatus={{agreementEContractStatus}}&contractStartTime={{contractStartTime}}&contractEndTime={{contractEndTime}}&skip={{skip}}&count={{count}}', {

                clientName: clientName,
                contractNumber: contractNumber,
                carCode: carCode,
                customerServiceId: customerServiceId,
                origin: origin,
                destination: destination,
                deliveryBegin: deliveryBegin,
                deliveryEnd: deliveryEnd,
                econtractStatus: econtractStatus,
                agreementEContractStatus: agreementEContractStatus,
                contractStartTime: contractStartTime,
                contractEndTime: contractEndTime,
                skip: skip,
                count: count
            })
        });
    }

    /**
     * 获取电子合同下载记录列表
     */
    getDownloadRecordList(clientName: string, contractNumber: string, econtractType: string, customerServiceId: string, downloadStartTime: string, downloadEndTime: string, skip: number, count: number): ng.IHttpPromise<ListResponse<EContractDownloadResponse>> {
        return this.http<ListResponse<EContractDownloadResponse>>({
            method: "GET",
            url: this.route.getUrl('operation/DownloadRecordList?clientName={{clientName}}&contractNumber={{contractNumber}}&econtractType={{econtractType}}&customerServiceId={{customerServiceId}}&downloadStartTime={{downloadStartTime}}&downloadEndTime={{downloadEndTime}}&skip={{skip}}&count={{count}}', {

                clientName: clientName,
                contractNumber: contractNumber,
                econtractType: econtractType,
                customerServiceId: customerServiceId,
                downloadStartTime: downloadStartTime,
                downloadEndTime: downloadEndTime,
                skip: skip,
                count: count
            })
        });
    }

    getOrderChildList(id: string): ng.IHttpPromise<ListResponse<orderChildListResponse>> {
        return this.http<ListResponse<orderChildListResponse>>({
            method: "GET",
            url: this.route.getUrl('operation/OrderChild?id={{id}}', {
                id: id
            })
        });
    }

    getFeeList(id: string): ng.IHttpPromise<ListResponse<feeListResponse>> {
        return this.http<ListResponse<feeListResponse>>({
            method: 'GET',
            url: this.route.getUrl('operation/FeeList?id={{id}}', {
                id: id
            })
        });
    }

    getReceivableList(id: string): ng.IHttpPromise<ListResponse<receivableListResponse>> {
        return this.http<ListResponse<receivableListResponse>>({
            method: 'GET',
            url: this.route.getUrl('operation/ReceivableList?id={{id}}', {
                id: id
            })
        });
    }

    getOrderDetail(id: string): ng.IHttpPromise<detailResponse> {
        return this.http<detailResponse>({
            method: 'GET',
            url: this.route.getUrl('operation/Detail?id={{id}}', {
                id: id
            })
        })
    }


    getOrderChildDetail(id: string): ng.IHttpPromise<orderChildResponse> {
        return this.http<orderChildResponse>({
            method: "GET",
            url: this.route.getUrl('operation/OrderChild?id={{id}}', {
                id: id
            })
        });
    }

    getCarryOrder(id: string): ng.IHttpPromise<carryOrderResponse> {
        return this.http<carryOrderResponse>({
            method: "GET",
            url: this.route.getUrl('operation/CarryOrder?id={{id}}', {
                id: id
            })
        });
    }

    getReportCarrierOrderList(orderby: string, asc: boolean, ContractNum: string, ClientName: string, ShipAddress: string, DeliverAddress: string, ShipStartTime: string, ShipEndTime: string, CarrierName: string, Driver: string, skip: number, count: number): ng.IHttpPromise<ListResponse<reportCarrierOrderListResponse>> {
        return this.http<ListResponse<reportCarrierOrderListResponse>>({
            method: "GET",
            url: this.route.getUrl('operation/ReportCarrierOrderList?orderby={{orderby}}&asc={{asc}}&ContractNum={{ContractNum}}&ClientName={{ClientName}}&ShipAddress={{ShipAddress}}&DeliverAddress={{DeliverAddress}}&ShipStartTime={{ShipStartTime}}&ShipEndTime={{ShipEndTime}}&CarrierName={{CarrierName}}&Driver={{Driver}}&skip={{skip}}&count={{count}}', {
                orderby: orderby,
                asc: asc,
                ContractNum: ContractNum,
                ClientName: ClientName,
                ShipAddress: ShipAddress,
                DeliverAddress: DeliverAddress,
                ShipStartTime: ShipStartTime,
                ShipEndTime: ShipEndTime,
                CarrierName: CarrierName,
                Driver: Driver,
                skip: skip,
                count: count
            })
        })
    }

    getBankList(carid: string, carrierid: string, BankCode: string, IsVehicle: boolean, skip: number, count: number): ng.IHttpPromise<ListResponse<BankListItemResponse>> {
        return this.http<ListResponse<BankListItemResponse>>({
            method: "GET",
            url: this.route.getUrl("operation/Bank?carid={{carid}}&carrierid={{carrierid}}&BankCode={{BankCode}}&IsVehicle={{IsVehicle}}&skip={{skip}}&count={{count}}", {
                carid: carid,
                carrierid: carrierid,
                BankCode: BankCode,
                IsVehicle: IsVehicle,
                skip: skip,
                count: count
            })
        });
    }


    getBankDetail(id: string): ng.IHttpPromise<BankDetailResponse> {
        return this.http<BankDetailResponse>({
            method: "GET",
            url: this.route.getUrl("operation/BankDetail?id={{id}}", {
                id: id
            })
        });
    }


    BankInfo(id: string): ng.IHttpPromise<string> {
        return this.http<string>({
            method: "GET",
            url: this.route.getUrl("operation/BankInfo?id={{id}}", {
                id: id
            })
        });
    }


    getCarList(orderby: string, asc: boolean, carcode: string, cartype: string, carlength: string, inputperson: string, driver: string, driverphone: string, carriercategory: string, mainroute: string,
        isenabled: boolean, skip: number, count: number): ng.IHttpPromise<ListResponse<CarListItemResponse>> {
        return this.http<ListResponse<CarListItemResponse>>({
            method: "GET",
            url: this.route.getUrl("operation/Car?orderby={{orderby}}&asc={{asc}}&carcode={{carcode}}&cartype={{cartype}}&carlength={{carlength}}&" +
                "inputperson={{inputperson}}&driver={{driver}}&driverphone={{driverphone}}&carriercategory={{carriercategory}}&mainroute={{mainroute}}" +
                "&isenabled={{isenabled}}&skip={{skip}}&count={{count}}", {
                    orderby: orderby,
                    asc: asc,
                    carcode: carcode,
                    cartype: cartype,
                    carlength: carlength,
                    inputperson: inputperson,
                    driver: driver,
                    driverphone: driverphone,
                    carriercategory: carriercategory,
                    mainroute: mainroute,
                    isenabled: isenabled,
                    skip: skip,
                    count: count
                })
        });
    }

    getTradingRecordList(carcode: string, goodsname: string, goodsnum: string, route: string, shipaddress: string, deliveraddress: string, skip: number, count: number): ng.IHttpPromise<ListResponse<TradingRecordListItemResponse>> {
        return this.http<ListResponse<TradingRecordListItemResponse>>({
            method: "GET",
            url: this.route.getUrl("operation/TradingRecord?carcode={{carcode}}&goodsname={{goodsname}}&" +
                "goodsnum={{goodsnum}}&route={{route}}&shipaddress={{shipaddress}}&deliveraddress={{deliveraddress}}&skip={{skip}}&count={{count}}", {
                    carcode: carcode,
                    goodsname: goodsname,
                    goodsnum: goodsnum,
                    route: route,
                    shipaddress: shipaddress,
                    deliveraddress: deliveraddress,
                    skip: skip,
                    count: count
                })
        });
    }

    getEvaluateList(carcode: string, appraiserid: string, skip: number, count: number): ng.IHttpPromise<ListResponse<EvaluateListItemResponse>> {
        return this.http<ListResponse<EvaluateListItemResponse>>({
            method: "GET",
            url: this.route.getUrl("operation/EvaluateList?carcode={{carcode}}&appraiserid={{appraiserid}}&skip={{skip}}&count={{count}}", {
                carcode: carcode,
                appraiserid: appraiserid,
                skip: skip,
                count: count
            })
        });
    }

    getCarDetail(id: string): ng.IHttpPromise<CarDetailResponse> {
        return this.http<CarDetailResponse>({
            method: "GET",
            url: this.route.getUrl("operation/CarDetail?id={{id}}", {
                id: id
            })
        });
    }

    getCarrierList(orderby: string, asc: boolean, name: string, phone: string, type: string, inputperson: string, level: string, mianroute: string, isenabled: boolean, skip: number, count: number): ng.IHttpPromise<ListResponse<CarrierListItemResponse>> {
        return this.http<ListResponse<CarrierListItemResponse>>({
            method: "GET",
            url: this.route.getUrl("operation/Carrier?orderby={{orderby}}&asc={{asc}}&name={{name}}&phone={{phone}}&type={{type}}&inputperson={{inputperson}}&level={{level}}&mainroute={{mainroute}}&isenabled={{isenabled}}&skip={{skip}}&count={{count}}", {
                orderby: orderby,
                asc: asc,
                name: encodeURIComponent(name),
                phone: phone,
                type: type,
                inputperson: inputperson,
                level: level,
                mainroute: mianroute,
                isenabled: isenabled,
                skip: skip,
                count: count
            })
        });
    }

    getBelongCarrierCarList(id: string, skip: number, count: number): ng.IHttpPromise<ListResponse<BelongCarrierCarListResponse>> {
        return this.http<any>({
            method: "GET",
            url: this.route.getUrl("operation/BelongCarrierCarList?id={{id}}&skip={{skip}}&count={{count}}", {
                id: id,
                skip: skip,
                count: count
            })
        });
    }

    getCarrierDetail(id: string): ng.IHttpPromise<CarrierDetailResponse> {
        return this.http<CarrierDetailResponse>({
            method: "GET",
            url: this.route.getUrl("operation/CarrierDetail?id={{id}}", {
                id: id
            })
        });
    }


    getRouteLineList(carid: string, carrierid: string, skip: number, count: number): ng.IHttpPromise<ListResponse<RouteLineListItemResponse>> {
        return this.http<ListResponse<RouteLineListItemResponse>>({
            method: "GET",
            url: this.route.getUrl("operation/Route?carid={{carid}}&carrierid={{carrierid}}&skip={{skip}}&count={{count}}", {
                carid: carid,
                carrierid: carrierid,
                skip: skip,
                count: count
            })
        });
    }

    updateCarrier(id: string, carrier: string, carrierId: string, carrierPhone: string, carrierType: string): ng.IHttpPromise<BaseResponse> {
        return this.http<BaseResponse>({
            method: "PUT",
            url: this.route.getUrl("operation/UpdateCarrier?id={{id}}", {
                id: id
            }),
            data: {
                carrier: carrier,
                carrierId: carrierId,
                carrierPhone: carrierPhone,
                carrierType: carrierType
            }
        });
    }


    updateCar(id: string, driverUserId: string, carCode: string, driver: string, driverPhone: string, carLength: string, vehicleType: string, permitNumber: string, countrySubdivisionProvinceCode: string, countrySubdivisionCityCode: string, countrySubdivisionCountryCode: string, roadTransportCertificateNumber: string): ng.IHttpPromise<BaseResponse> {
        return this.http<BaseResponse>({
            method: "PUT",
            url: this.route.getUrl("operation/UpdateCar?id={{id}}", {
                id: id
            }),
            data: {
                driverUserId: driverUserId,
                carCode: carCode,
                driver: driver,
                driverPhone: driverPhone,
                carLength: carLength,
                vehicleType: vehicleType,
                permitNumber: permitNumber,
                countrySubdivisionProvinceCode: countrySubdivisionProvinceCode,
                countrySubdivisionCityCode: countrySubdivisionCityCode,
                countrySubdivisionCountryCode: countrySubdivisionCountryCode,
                roadTransportCertificateNumber: roadTransportCertificateNumber
            }
        });
    }


    updatePayable(id: string, payablePrice: number, payableSummary: string, receiptPrice: number, bankCode: string, bankName: string, holder: string,
        payablePriceUnit: string, receiptPriceUnit: string, advancePaymentList: Array<advanceList>): ng.IHttpPromise<BaseResponse> {
        return this.http<BaseResponse>({
            method: "PUT",
            url: this.route.getUrl("operation/UpdatePayable?id={{id}}", {
                id: id
            }),
            data: {
                payablePrice: payablePrice,
                payableSummary: payableSummary,
                receiptPrice: receiptPrice,
                bankCode: bankCode,
                bankName: bankName,
                holder: holder,
                payablePriceUnit: payablePriceUnit,
                receiptPriceUnit: receiptPriceUnit,
                advancePaymentList: advancePaymentList
            }
        });
    }


    updateContract(carrierOrderId: string, contractId: string, contractNumber: string, contractGoodsNum: number, contractGoodsNumUnit: string, oilCarNum: string, OilCardStatus: string, auxiliaryTool: string,
        engineNumber: string, frameNumber: string, trailerNumber: string, trailerFrameNumber: string, driverLicenseNumber: string, altermatePhone: string,totalPrice:number,remarks:string): ng.IHttpPromise<BaseResponse> {
        return this.http<BaseResponse>({
            method: "PUT",
            url: this.route.getUrl("operation/UpdateContract"),
            data: {
                carrierOrderId: carrierOrderId,
                contractId: contractId,
                contractNumber: contractNumber,
                contractGoodsNum: contractGoodsNum,
                contractGoodsNumUnit: contractGoodsNumUnit,
                oilCarNum: oilCarNum,
                OilCardStatus: OilCardStatus,
                auxiliaryTool: auxiliaryTool,
                engineNumber: engineNumber,
                frameNumber: frameNumber,
                trailerNumber: trailerNumber,
                trailerFrameNumber: trailerFrameNumber,
                driverLicenseNumber: driverLicenseNumber,
                altermatePhone: altermatePhone,
                totalPrice:totalPrice,
                remarks:remarks
            }
        });
    }

    updateAttachment(carrierOrderId: string, attachmentList: Array<string>): ng.IHttpPromise<BaseResponse> {
        return this.http<BaseResponse>({
            method: "PUT",
            url: this.route.getUrl("operation/UpdateAttachment"),
            data: {
                carrierOrderId: carrierOrderId,
                attachmentList: attachmentList
            }
        });
    }


    //意见反馈列表
    getOpinionList(platform: string, feedBackName: string, startTime: string, endTime: string, skip: number, count: number): ng.IHttpPromise<ListResponse<feedBackListResponse>> {
        return this.http<ListResponse<feedBackListResponse>>({
            method: "GET",
            url: this.route.getUrl("opinion?platform={{platform}}&feedBackName={{feedBackName}}&startTime={{startTime}}&endTime={{endTime}}&skip={{skip}}&count={{count}}", {
                platform: platform,
                feedBackName: feedBackName,
                startTime:startTime,
                endTime:endTime,
                skip: skip,
                count: count
            })
        });
    }

    //意见反馈详情
    getOpinionDetail(id: string): ng.IHttpPromise<FeedBackDetailResponse> {
        return this.http<FeedBackDetailResponse>({
            method: "GET",
            url: this.route.getUrl("opinion/{{id}}", {
                id: id
            })
        });
    }

    //添加意见反馈
    addOpinion(Title: string, Content: string, FeedBackPlatform: string, Attachment: Array<attachmentList>): ng.IHttpPromise<BaseResponse>{
        return this.http<BaseResponse>({
            method: "POST",
            url: this.route.getUrl("opinion/AddOpinion"),//tms/opinion
            data: {
                Title: Title,
                Content: Content,
                FeedBackPlatform: FeedBackPlatform,
                Attachment: Attachment
            }
        });
    }

}
angular.module("operationService", []).service("operationService", ['$http', 'routeService', operationService]);